home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / cprog / metre.lha / lex_yy.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-07  |  59.3 KB  |  1,847 lines

  1. #define YYNEWLINE 10
  2. #define INITIAL 0
  3. #define YY_LA_SIZE 35
  4.  
  5. static unsigned short yy_la_act[] = {
  6.  85, 95, 34, 95, 34, 95, 34, 95, 34, 95, 34, 95, 34, 95, 34, 95,
  7.  34, 95, 34, 95, 34, 95, 34, 95, 34, 95, 34, 95, 34, 95, 34, 95,
  8.  34, 95, 39, 40, 95, 39, 40, 95, 95, 78, 95, 95, 88, 95, 87, 95,
  9.  83, 95, 82, 95, 84, 95, 86, 95, 79, 95, 89, 95, 90, 95, 73, 95,
  10.  80, 95, 68, 95, 69, 95, 70, 95, 71, 95, 72, 95, 74, 95, 75, 95,
  11.  76, 95, 77, 95, 81, 95, 91, 95, 92, 95, 93, 95, 67, 66, 56, 63,
  12.  55, 54, 62, 53, 51, 50, 60, 61, 49, 59, 58, 64, 48, 57, 65, 47,
  13.  45, 43, 46, 43, 43, 43, 43, 43, 41, 39, 40, 39, 40, 39, 40, 39,
  14.  40, 39, 40, 44, 43, 44, 44, 44, 44, 44, 44, 43, 44, 43, 44, 43,
  15.  44, 43, 44, 43, 44, 42, 42, 42, 42, 42, 37, 38, 39, 40, 37, 38,
  16.  39, 40, 37, 38, 39, 40, 37, 38, 39, 40, 37, 38, 39, 40, 35, 36,
  17.  35, 36, 35, 36, 35, 36, 35, 36, 34, 34, 34, 34, 34, 33, 34, 34,
  18.  34, 34, 34, 34, 34, 34, 32, 34, 31, 34, 34, 34, 34, 34, 34, 34,
  19.  34, 30, 34, 34, 29, 34, 34, 34, 34, 34, 34, 28, 34, 34, 34, 34,
  20.  34, 34, 34, 34, 27, 34, 34, 34, 34, 34, 26, 34, 34, 34, 25, 34,
  21.  34, 34, 34, 34, 24, 34, 34, 34, 23, 34, 34, 34, 22, 34, 34, 34,
  22.  34, 34, 34, 21, 34, 34, 34, 34, 34, 20, 34, 34, 34, 19, 34, 17,
  23.  34, 34, 18, 34, 34, 34, 16, 34, 34, 34, 15, 34, 34, 34, 14, 34,
  24.  34, 34, 34, 34, 34, 34, 13, 34, 34, 12, 34, 34, 11, 34, 34, 9,
  25.  34, 34, 34, 34, 10, 34, 34, 34, 34, 34, 8, 34, 34, 34, 34, 34,
  26.  34, 34, 34, 34, 34, 7, 34, 6, 34, 34, 5, 34, 34, 4, 34, 34,
  27.  34, 34, 3, 34, 34, 34, 2, 34, 0, 52, 92, 95, 94, 95, 94, 94,
  28.  1, 94, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 94,
  29.  94, 94, 94, 94,
  30. };
  31.  
  32. static unsigned char yy_look[] = {
  33.  0
  34. };
  35.  
  36. static short yy_final[] = {
  37.  0, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28,
  38.  30, 32, 34, 37, 40, 41, 43, 44, 46, 48, 50, 52, 54, 56, 58, 60,
  39.  62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 91,
  40.  92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
  41.  108, 109, 110, 111, 112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 117, 118,
  42.  119, 119, 120, 120, 120, 121, 121, 123, 125, 127, 129, 131, 131, 132, 134, 134,
  43.  135, 136, 137, 138, 138, 139, 139, 141, 143, 145, 147, 147, 149, 149, 150, 151,
  44.  152, 153, 154, 154, 158, 162, 166, 170, 174, 176, 178, 180, 182, 184, 185, 186,
  45.  187, 188, 189, 191, 192, 193, 194, 195, 196, 197, 198, 200, 202, 203, 204, 205,
  46.  206, 207, 208, 209, 211, 212, 214, 215, 216, 217, 218, 219, 221, 222, 223, 224,
  47.  225, 226, 227, 228, 230, 231, 232, 233, 234, 236, 237, 238, 240, 241, 242, 243,
  48.  244, 246, 247, 248, 250, 251, 252, 254, 255, 256, 257, 258, 259, 261, 262, 263,
  49.  264, 265, 267, 268, 269, 271, 273, 274, 276, 277, 278, 280, 281, 282, 284, 285,
  50.  286, 288, 289, 290, 291, 292, 293, 294, 296, 297, 299, 300, 302, 303, 305, 306,
  51.  307, 308, 310, 311, 312, 313, 314, 316, 317, 318, 319, 320, 321, 322, 323, 324,
  52.  325, 327, 329, 330, 332, 333, 335, 336, 337, 338, 340, 341, 342, 344, 345, 346,
  53.  346, 348, 350, 351, 352, 354, 355, 357, 359, 361, 363, 365, 367, 368, 369, 370,
  54.  371, 371, 372
  55. };
  56. typedef unsigned short yy_state_t;
  57. #define    yy_endst 274
  58. #define    yy_nxtmax 1877
  59.  
  60. static yy_state_t yy_begin[] = {
  61.  0, 255, 0
  62. };
  63.  
  64. static yy_state_t yy_next[] = {
  65.  47, 47, 47, 47, 47, 47, 47, 47, 47, 45, 46, 45, 45, 47, 47, 47,
  66.  47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
  67.  45, 33, 22, 47, 17, 28, 29, 20, 39, 40, 27, 25, 37, 26, 21, 1,
  68.  18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 38, 34, 24, 32, 23, 44,
  69.  47, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  70.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 41, 47, 42, 30, 17,
  71.  47, 2, 3, 4, 5, 6, 7, 8, 17, 9, 17, 17, 10, 17, 17, 17,
  72.  17, 17, 11, 12, 13, 14, 15, 16, 17, 17, 17, 35, 31, 36, 43, 47,
  73.  48, 49, 50, 52, 54, 55, 56, 58, 61, 62, 63, 64, 66, 65, 67, 74,
  74.  274, 274, 274, 274, 274, 127, 274, 57, 59, 128, 60, 53, 73, 129, 72, 72,
  75.  72, 72, 72, 72, 72, 72, 72, 72, 80, 274, 80, 274, 130, 81, 81, 81,
  76.  81, 81, 81, 81, 81, 81, 81, 131, 132, 134, 135, 133, 136, 137, 138, 139,
  77.  140, 51, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
  78.  69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
  79.  69, 69, 69, 69, 70, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
  80.  69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
  81.  69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
  82.  69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 68, 69,
  83.  69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
  84.  69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
  85.  69, 69, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 143, 71, 71, 71,
  86.  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  87.  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  88.  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  89.  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  90.  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  91.  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  92.  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  93.  71, 71, 274, 274, 144, 274, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
  94.  101, 103, 145, 146, 90, 147, 119, 105, 148, 75, 77, 94, 96, 88, 77, 117,
  95.  79, 99, 98, 99, 79, 149, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
  96.  101, 102, 150, 151, 89, 152, 118, 104, 153, 75, 76, 94, 95, 87, 76, 116,
  97.  78, 154, 97, 155, 78, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  98.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  99.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 160, 83, 83, 83,
  100.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  101.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  102.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  103.  83, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  104.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  105.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  106.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  107.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 83, 83, 83,
  108.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  109.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  110.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  111.  83, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  112.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  113.  83, 83, 83, 83, 83, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 161,
  114.  85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
  115.  85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
  116.  85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
  117.  85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
  118.  85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
  119.  85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
  120.  85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
  121.  85, 85, 85, 85, 85, 92, 162, 86, 86, 86, 86, 86, 86, 86, 86, 86,
  122.  86, 124, 274, 141, 274, 124, 156, 157, 163, 164, 122, 166, 91, 142, 122, 167,
  123.  168, 169, 158, 90, 274, 159, 274, 170, 171, 174, 165, 175, 88, 96, 172, 176,
  124.  177, 123, 178, 98, 179, 123, 180, 181, 182, 183, 121, 184, 91, 186, 121, 103,
  125.  187, 173, 188, 89, 189, 105, 190, 191, 185, 192, 193, 194, 87, 95, 195, 106,
  126.  196, 106, 199, 97, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 274, 102,
  127.  274, 108, 200, 108, 201, 104, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
  128.  197, 202, 203, 205, 206, 204, 207, 208, 198, 111, 212, 213, 214, 215, 216, 113,
  129.  115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
  130.  115, 115, 115, 115, 209, 217, 210, 218, 219, 110, 220, 222, 223, 224, 225, 112,
  131.  211, 226, 227, 228, 221, 229, 119, 230, 114, 231, 234, 235, 236, 237, 238, 117,
  132.  232, 239, 240, 241, 242, 243, 244, 233, 120, 120, 120, 120, 120, 120, 120, 120,
  133.  120, 120, 245, 246, 247, 248, 118, 249, 114, 120, 120, 120, 120, 120, 120, 116,
  134.  250, 251, 125, 252, 274, 253, 274, 274, 274, 274, 274, 274, 274, 274, 126, 126,
  135.  126, 126, 126, 126, 126, 126, 126, 126, 254, 120, 120, 120, 120, 120, 120, 125,
  136.  125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
  137.  125, 125, 125, 125, 125, 125, 125, 125, 125, 274, 274, 274, 274, 125, 274, 125,
  138.  125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
  139.  125, 125, 125, 125, 125, 125, 125, 125, 125, 256, 274, 256, 256, 274, 274, 274,
  140.  274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
  141.  256, 274, 274, 257, 261, 261, 261, 261, 261, 261, 261, 261, 261, 258, 274, 261,
  142.  261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
  143.  261, 261, 261, 261, 258, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
  144.  261, 261, 261, 261, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 261, 261,
  145.  261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
  146.  261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
  147.  261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
  148.  259, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
  149.  261, 261, 261, 261, 261, 272, 274, 272, 272, 274, 274, 274, 274, 274, 264, 274,
  150.  274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 261, 272, 274, 274, 273,
  151.  274, 274, 274, 274, 274, 264, 274, 274, 274, 274, 274, 261, 261, 261, 261, 261,
  152.  261, 261, 261, 261, 261, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 265,
  153.  274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 264, 264, 264,
  154.  264, 264, 264, 264, 264, 264, 264, 274, 274, 274, 274, 274, 274, 264, 264, 264,
  155.  264, 264, 264, 264, 264, 264, 263, 261, 264, 264, 264, 264, 264, 264, 264, 264,
  156.  264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 263, 264, 264,
  157.  264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 262, 262, 262,
  158.  262, 262, 262, 262, 262, 262, 262, 264, 264, 264, 264, 264, 264, 264, 264, 264,
  159.  264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
  160.  264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
  161.  264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
  162.  264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 266, 266, 266,
  163.  266, 266, 266, 266, 266, 266, 266, 274, 266, 266, 266, 266, 266, 266, 266, 266,
  164.  266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 267,
  165.  266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
  166.  266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
  167.  266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
  168.  266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
  169.  266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
  170.  266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 264, 271, 274,
  171.  274, 274, 274, 274, 274, 274, 274, 261, 274, 274, 274, 274, 274, 274, 274, 274,
  172.  274, 274, 274, 274, 264, 271, 274, 274, 274, 274, 274, 274, 274, 274, 261, 274,
  173.  274, 261, 274, 274, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 261, 261,
  174.  261, 261, 261, 261, 261, 261, 261, 261, 261, 274, 274, 274, 274, 274, 274, 274,
  175.  274, 274, 274, 274, 261, 274, 274, 274, 261, 261, 261, 261, 261, 261, 261, 261,
  176.  261, 261, 271, 274, 274, 274, 274, 274, 274, 274, 274, 261, 274, 274, 274, 274,
  177.  274, 261, 274, 274, 274, 274, 274, 268, 274, 271, 261, 261, 261, 261, 261, 261,
  178.  261, 261, 261, 261, 261, 274, 274, 274, 274, 261, 261, 261, 261, 261, 261, 261,
  179.  261, 261, 261, 274, 261, 274, 269, 274, 274, 274, 274, 274, 274, 274, 274, 274,
  180.  274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
  181.  270, 274, 274, 274, 274, 274, 274, 261, 274, 274, 274, 274, 274, 274, 274, 274,
  182.  274, 274, 274, 274, 274, 261,
  183. };
  184.  
  185. static yy_state_t yy_check[] = {
  186.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  187.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  188.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  189.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  190.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  191.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  192.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  193.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  194.  33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 24, 62, 23, 23, 65, 73,
  195.  80, 99, 80, 99, 106, 16, 106, 26, 26, 127, 25, 29, 21, 128, 21, 21,
  196.  21, 21, 21, 21, 21, 21, 21, 21, 75, 108, 75, 108, 129, 75, 75, 75,
  197.  75, 75, 75, 75, 75, 75, 75, 15, 131, 133, 134, 131, 135, 136, 137, 132,
  198.  14, 31, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  199.  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  200.  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  201.  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  202.  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  203.  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  204.  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  205.  22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  206.  22, 22, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 142, 68, 68, 68,
  207.  68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
  208.  68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
  209.  68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
  210.  68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
  211.  68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
  212.  68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
  213.  68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
  214.  68, 68, 72, 81, 143, 81, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
  215.  93, 93, 144, 145, 90, 146, 119, 93, 141, 72, 72, 92, 92, 90, 81, 119,
  216.  72, 94, 92, 94, 81, 148, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
  217.  93, 93, 13, 150, 90, 151, 119, 93, 152, 72, 72, 92, 92, 90, 81, 119,
  218.  72, 153, 92, 154, 81, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  219.  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  220.  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 159, 20, 20, 20,
  221.  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  222.  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  223.  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  224.  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  225.  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  226.  20, 20, 20, 20, 20, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  227.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  228.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  229.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  230.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  231.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  232.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  233.  83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  234.  83, 83, 83, 83, 83, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 160,
  235.  82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
  236.  82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
  237.  82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
  238.  82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
  239.  82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
  240.  82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
  241.  82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
  242.  82, 82, 82, 82, 82, 19, 161, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  243.  19, 120, 100, 140, 100, 124, 12, 12, 162, 158, 120, 165, 19, 140, 124, 166,
  244.  167, 164, 12, 19, 107, 12, 107, 169, 170, 173, 158, 174, 19, 100, 157, 175,
  245.  172, 120, 177, 100, 178, 124, 156, 180, 181, 11, 120, 183, 19, 185, 124, 107,
  246.  186, 157, 187, 19, 184, 107, 189, 190, 183, 191, 192, 10, 19, 100, 194, 101,
  247.  195, 101, 198, 100, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 109, 107,
  248.  109, 91, 8, 91, 200, 107, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
  249.  9, 201, 7, 204, 203, 7, 206, 207, 9, 109, 211, 212, 213, 214, 210, 109,
  250.  18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 115, 115, 115, 115, 115, 115,
  251.  115, 115, 115, 115, 6, 216, 6, 209, 218, 109, 5, 221, 222, 223, 224, 109,
  252.  6, 220, 226, 227, 5, 228, 115, 229, 18, 4, 233, 234, 234, 236, 237, 115,
  253.  4, 238, 239, 235, 232, 242, 231, 4, 114, 114, 114, 114, 114, 114, 114, 114,
  254.  114, 114, 244, 3, 246, 247, 115, 248, 18, 114, 114, 114, 114, 114, 114, 115,
  255.  2, 250, 17, 251, ~0, 1, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, 17, 17,
  256.  17, 17, 17, 17, 17, 17, 17, 17, 1, 114, 114, 114, 114, 114, 114, 17,
  257.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  258.  17, 17, 17, 17, 17, 17, 17, 17, 17, ~0, ~0, ~0, ~0, 17, ~0, 17,
  259.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  260.  17, 17, 17, 17, 17, 17, 17, 17, 17, 255, ~0, 255, 255, ~0, ~0, ~0,
  261.  ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
  262.  255, ~0, ~0, 255, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, ~0, 257,
  263.  257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
  264.  257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
  265.  257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
  266.  257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
  267.  257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
  268.  257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
  269.  257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
  270.  257, 257, 257, 257, 261, 256, ~0, 256, 256, ~0, ~0, ~0, ~0, ~0, 264, ~0,
  271.  ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, 261, 256, ~0, ~0, 256,
  272.  ~0, ~0, ~0, ~0, ~0, 264, ~0, ~0, ~0, ~0, ~0, 261, 261, 261, 261, 261,
  273.  261, 261, 261, 261, 261, 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, 263,
  274.  ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, 263, 263, 263,
  275.  263, 263, 263, 263, 263, 263, 263, ~0, ~0, ~0, ~0, ~0, ~0, 260, 260, 260,
  276.  260, 260, 260, 260, 260, 260, 260, 261, 260, 260, 260, 260, 260, 260, 260, 260,
  277.  260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
  278.  260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
  279.  260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
  280.  260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
  281.  260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
  282.  260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
  283.  260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 265, 265, 265,
  284.  265, 265, 265, 265, 265, 265, 265, ~0, 265, 265, 265, 265, 265, 265, 265, 265,
  285.  265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
  286.  265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
  287.  265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
  288.  265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
  289.  265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
  290.  265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265,
  291.  265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 267, 271, ~0,
  292.  ~0, ~0, ~0, ~0, ~0, ~0, ~0, 259, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
  293.  ~0, ~0, ~0, ~0, 267, 271, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, 259, ~0,
  294.  ~0, 268, ~0, ~0, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 259, 259,
  295.  259, 259, 259, 259, 259, 259, 259, 259, 268, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
  296.  ~0, ~0, ~0, ~0, 269, ~0, ~0, ~0, 268, 268, 268, 268, 268, 268, 268, 268,
  297.  268, 268, 270, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, 269, ~0, ~0, ~0, ~0,
  298.  ~0, 271, ~0, ~0, ~0, ~0, ~0, 259, ~0, 270, 259, 269, 269, 269, 269, 269,
  299.  269, 269, 269, 269, 269, ~0, ~0, ~0, ~0, 270, 270, 270, 270, 270, 270, 270,
  300.  270, 270, 270, ~0, 268, ~0, 268, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
  301.  ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
  302.  269, ~0, ~0, ~0, ~0, ~0, ~0, 269, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
  303.  ~0, ~0, ~0, ~0, ~0, 270,
  304. };
  305.  
  306. static yy_state_t yy_default[] = {
  307.  274, 274, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  308.  17, 274, 19, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
  309.  274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
  310.  274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
  311.  274, 274, 274, 274, 274, 22, 274, 22, 21, 274, 274, 274, 274, 274, 274, 274,
  312.  75, 75, 274, 274, 274, 83, 19, 90, 90, 90, 274, 274, 274, 92, 274, 274,
  313.  274, 274, 274, 94, 94, 274, 274, 274, 274, 274, 101, 101, 91, 91, 274, 274,
  314.  274, 274, 274, 19, 119, 119, 119, 274, 114, 124, 124, 124, 274, 17, 17, 17,
  315.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  316.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  317.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  318.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  319.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  320.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  321.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
  322.  17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 274, 274, 0,
  323.  274, 274, 257, 257, 274, 257, 260, 260, 260, 274, 265, 260, 257, 257, 257, 257,
  324.  256, 257,
  325. };
  326.  
  327. static short yy_base[] = {
  328.  0, 1067, 987, 977, 968, 949, 936, 902, 883, 906, 860, 852, 814, 377, 82, 72,
  329.  45, 1070, 976, 855, 517, 110, 194, 79, 77, 93, 90, 73, 72, 94, 70, 69,
  330.  68, 67, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878,
  331.  1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 78, 1878,
  332.  1878, 81, 1878, 1878, 322, 1878, 1878, 1878, 404, 97, 1878, 125, 1878, 1878, 1878, 1878,
  333.  101, 408, 773, 645, 1878, 1878, 1878, 1878, 1878, 1878, 392, 950, 406, 395, 438, 1878,
  334.  1878, 1878, 1878, 102, 871, 932, 1878, 1878, 1878, 1878, 105, 889, 126, 947, 1878, 1878,
  335.  1878, 1878, 1032, 986, 1878, 1878, 1878, 394, 837, 1878, 1878, 1878, 841, 1878, 1878, 48,
  336.  49, 71, 1878, 79, 91, 88, 70, 83, 81, 89, 1878, 1878, 810, 361, 227, 349,
  337.  356, 366, 369, 1878, 375, 1878, 387, 400, 404, 412, 413, 1878, 839, 839, 824, 451,
  338.  667, 803, 816, 1878, 813, 806, 828, 812, 1878, 830, 837, 1878, 834, 836, 828, 841,
  339.  1878, 845, 848, 1878, 837, 836, 1878, 852, 859, 840, 846, 852, 1878, 851, 851, 868,
  340.  856, 1878, 864, 873, 1878, 1878, 862, 1878, 880, 898, 1878, 901, 897, 1878, 917, 899,
  341.  1878, 932, 905, 902, 918, 906, 911, 1878, 936, 1878, 947, 1878, 955, 934, 954, 945,
  342.  953, 1878, 961, 942, 953, 947, 1878, 963, 979, 956, 952, 959, 964, 960, 956, 973,
  343.  1878, 1878, 963, 1878, 989, 1878, 991, 996, 988, 1878, 989, 996, 1878, 1878, 1878, 1184,
  344.  1340, 1220, 1878, 1694, 1437, 1339, 1878, 1373, 1349, 1565, 1878, 1684, 1720, 1755, 1769, 1685,
  345.  1878, 1878, 1878
  346. };
  347.  
  348.  
  349. #line 1 "c:\mks/etc/yylex.c"
  350. /*
  351.  * Copyright 1988, 1990 by Mortice Kern Systems Inc.
  352.  * All rights reserved.
  353.  */
  354. #include <stdio.h>
  355. /*
  356.  * Define gettext() to an appropriate function for internationalized messages
  357.  * or custom processing.
  358.  */
  359. #ifndef I18N
  360. #define gettext(s)    (s)
  361. #endif
  362. /*
  363.  * Include string.h to get definition of memmove() and size_t.
  364.  * If you do not have string.h or it does not declare memmove
  365.  * or size_t, you will have to declare them here.
  366.  */
  367. #include <string.h>
  368. /* Uncomment next line if memmove() is not declared in string.h */
  369. /*extern char * memmove();*/
  370. /* Uncomment next line if size_t is not available in stdio.h or string.h */
  371. /*typedef unsigned size_t;*/
  372. /* Drop this when LATTICE provides memmove */
  373. #ifdef LATTICE
  374. #define memmove    memcopy
  375. #endif
  376.  
  377. /*
  378.  * YY_STATIC determines the scope of variables and functions
  379.  * declared by the lex scanner. It must be set with a -DYY_STATIC
  380.  * option to the compiler (it cannot be defined in the lex program).
  381.  */
  382. #ifdef    YY_STATIC
  383. /* define all variables as static to allow more than one lex scanner */
  384. #define    YY_DECL    static
  385. #else
  386. /* define all variables as global to allow other modules to access them */
  387. #define    YY_DECL    
  388. #endif
  389.  
  390. #ifdef __STDC__
  391. #define    YY_ARGS(_args_)    _args_
  392. #else
  393. #define    YY_ARGS(_args_)    ()
  394. #endif
  395.  
  396. /*
  397.  * the following can be redefined by the user.
  398.  */
  399. #define    ECHO        fputs(yytext, yyout)
  400. #define    yygetc()    getc(yyin)     /* yylex input source */
  401. #define    output(c)    putc((c), yyout) /* yylex sink for unmatched chars */
  402. #define    YY_FATAL(msg)    { fprintf(stderr, "yylex: %s\n", msg); exit(1); }
  403. #define    YY_INTERACTIVE    1        /* save micro-seconds if 0 */
  404. #define    YYLMAX        100        /* token and pushback buffer size */
  405.  
  406. /*
  407.  * the following must not be redefined.
  408.  */
  409. #define    yy_tbuf    yytext        /* token string */
  410.  
  411. #define    BEGIN        yy_start =
  412. #define    REJECT        goto yy_reject
  413. #define    NLSTATE        (yy_lastc = YYNEWLINE)
  414. #define    YY_INIT        (yy_start = 0, yyleng = yy_end = 0, yy_lastc = YYNEWLINE)
  415. #define    yymore()    goto yy_more
  416. #define    yyless(n)    if ((n) < 0 || (n) > yy_end) ; \
  417.             else { YY_SCANNER; yyleng = (n); YY_USER; }
  418.  
  419. YY_DECL    int    input    YY_ARGS((void));
  420. YY_DECL    int    unput    YY_ARGS((int c));
  421.  
  422. /* functions defined in libl.lib */
  423. extern    int    yywrap    YY_ARGS((void));
  424. extern    void    yyerror    YY_ARGS((char *fmt, ...));
  425. extern    void    yycomment    YY_ARGS((char *term));
  426. extern    int    yymapch    YY_ARGS((int delim, int escape));
  427.  
  428. #line 8 "scan.l"
  429.  
  430. /*************************************************************
  431.    Copyright (c) 1993,1994 by Paul Long  All rights reserved.
  432. **************************************************************/
  433.  
  434. /*************************************************************
  435.    scan.l - This source file contains the lex specification
  436.             for Metre's Standard C lexer.  It also contains
  437.             lexical functions that can be called from the
  438.             rules() function and replacement functions for
  439.             lex's yywrap() and MKS lex's yygetc().
  440. **************************************************************/
  441.  
  442.  
  443. #include <stdio.h>
  444. #include <ctype.h>
  445. #include "ytab.h"
  446. #include "metreint.h"
  447.  
  448.  
  449. /*
  450.    Decide which lex is being used based on whether YY_INIT and YY_INPUT are
  451.    defined.  It is my belief that the 4 combinations of whether these two
  452.    manifest constants are defined coincidentally indicates which lex is being
  453.    used.  I know that this method works with MKS and AT&T lex; from reading
  454.    John Levine's book, "lex & yacc," I also believe that it works with flex
  455.    and pclex.  Note: Berkeley is considered same as AT&T lex, and Posix is not
  456.    considered at all.
  457. */
  458. #ifdef YY_INIT
  459. #ifdef YY_INPUT
  460. #define MTR_PCLEX
  461. #else
  462. #define MTR_MKSLEX
  463. #endif
  464. #else
  465. #ifdef YY_INPUT
  466. #define MTR_FLEX
  467. #else
  468. #define MTR_ATTLEX
  469. #endif
  470. #endif
  471.  
  472. /*
  473.    Redefine size of miniscule yytext[].  Should have no affect on other lex's.
  474. */
  475. #define MTR_YYTEXT_SIZE 500
  476. /*
  477.    Redefine for MKS and AT&T lex.  I don't explicitly test for MTR_MKSLEX or
  478.    MTR_ATTLEX because YYLMAX should only be defined for them.
  479. */
  480. #ifdef YYLMAX
  481. #if YYLMAX < MTR_YYTEXT_SIZE
  482. #undef YYLMAX
  483. #define YYLMAX MTR_YYTEXT_SIZE
  484. #endif
  485. #endif
  486. /*
  487.    Redefine for pclex.  I don't explicitly test for MTR_PCLEX because F_BUFSIZ
  488.    should only be defined for it.
  489. */
  490. #ifdef F_BUFSIZ
  491. #if F_BUFSIZ < MTR_YYTEXT_SIZE
  492. #undef F_BUFSIZ
  493. #define F_BUFSIZ MTR_YYTEXT_SIZE
  494. #endif
  495. #endif
  496.  
  497. /*
  498.    Prior to version 2.4, flex defined a yywrap() macro.  Undefine it just in
  499.    case, because I define a yywrap() function.  This shouldn't affect the other
  500.    lex's.
  501. */
  502. #ifdef yywrap
  503. #undef yywrap
  504. #endif
  505.  
  506.  
  507. #if READ_LINE
  508.  
  509. /*
  510.    I provide a function to replace MKS' yygetc() macro, so undefine the macro.
  511.    Should have no affect on other lex's.  That's why I don't explicitly test
  512.    for MTR_MKSLEX.
  513. */
  514. #ifdef yygetc
  515. #undef yygetc
  516. #endif
  517.  
  518. /*
  519.    AT&T lex uses stdio.h's getc() to read in characters in its input() macro.
  520.    Assuming that getc() is a macro in stdio.h, redefine it to call my
  521.    yygetc() macro.
  522. */
  523. #ifdef MTR_ATTLEX
  524. #ifdef getc
  525. #undef getc
  526. #endif
  527. #define getc(x)   yygetc()
  528. #endif
  529.  
  530. /*
  531.    The following directives hopefully make Metre compatible with flex and
  532.    pclex.  I don't have either, so I can't test this.  From reading John
  533.    Levine's book, "lex & yacc," flex/pclex expects the YY_INPUT() macro to
  534.    read a block of data.  If flex/pclex is used, it will use my definition.
  535.    If flex/pclex is not used, MKS and AT&T lex will use it indirectly because
  536.    yygetc() and getc(), respectively, also use the macro.
  537.  
  538.    This diagram shows the dependencies and how Metre achieves compatibility
  539.    with the three lex's.
  540.  
  541.       getc()                     <-- AT&T lex uses
  542.          yygetc()                <-- MKS lex uses
  543.             YY_INPUT()           <-- flex/pclex uses
  544.                my_yyinput()
  545. */
  546. #ifdef YY_INPUT
  547. #undef YY_INPUT
  548. #endif
  549. #define YY_INPUT(b, r, ms) (r = my_yyinput(b, ms))
  550.  
  551. /* Size of input buffer.  Must be as large as the largest expected line. */
  552. #define INPUT_LINE_MAX_LEN    2048
  553.  
  554. #endif      /* #if READ_LINE */
  555.  
  556.  
  557. /* Define how to restart lexer based on which lex is being used. */
  558. #if defined(MTR_MKSLEX) || defined(MTR_PCLEX)
  559. #define MTR_YY_INIT  YY_INIT
  560. #elif defined(MTR_FLEX)
  561. #define MTR_YY_INIT  yyrestart(yyin)
  562. #elif defined(MTR_ATTLEX)
  563. #define MTR_YY_INIT  yy_init()
  564. #else
  565. #error Unsupported version of lex
  566. #endif
  567.  
  568.  
  569. /* External variables. */
  570.  
  571. /*
  572.    Whether to interleave the input with the output.  Set according to the
  573.    copy-input option character from the command line.
  574. */
  575. BOOLEAN display_input;
  576.  
  577. #if defined(MTR_MKSLEX) || defined(MTR_ATTLEX)
  578. /* Do nothing--the lex takes care of it. */
  579. #define INCR_YYLINENO
  580. #else
  581. /*
  582.    I know that MKS and AT&T lex support yylineno.  Don't know about the
  583.    others.  Here's one for them.  I use the technique described in
  584.    John Levine's book, "lex & yacc," of simply incrementing a line counter
  585.    whenever a newline is encountered in the input stream.  However, this is not
  586.    as accurate as how MKS and AT&T lex do it.  They increment the line counter
  587.    when the input() macro encounters a newline and decrement it when it is
  588.    pushed back via the unput() macro.  This overcomes the problem of
  589.    incrementing the line counter prematurely during look-ahead.  I took the
  590.    easy way out for lex's other than MKS or AT&T--I didn't want to provide my
  591.    own input() and output() macros for them.  You could modify them, though.
  592. */
  593. int yylineno;
  594. #define INCR_YYLINENO   (++yylineno)
  595. #endif
  596.  
  597.  
  598. /* Function prototypes for static functions. */
  599. #if READ_LINE
  600. static int yygetc(void);
  601. static int my_yyinput(char *, int);
  602. #endif
  603. static void count(void);
  604. static void comment(void);
  605. static void fire_keyword(void);
  606. static void fire_identifier(void);
  607. static void found_nonstandard(void);
  608. static BOOLEAN identifier_defined(char *);
  609. static int check_type(void);
  610. static unsigned extract_line_number(char *);
  611. static char *extract_file_name(char *);
  612. #ifdef MTR_ATTLEX
  613. static void yy_init(void);
  614. #endif
  615.  
  616. /* Static variables. */
  617.  
  618. #if READ_LINE
  619. /*
  620.    I read the input line into here then feed the lexer one character at a time
  621.    from that.  This is so that I have the entire line available in case I
  622.    need to print the line along with an error message.
  623. */
  624. static char input_line[INPUT_LINE_MAX_LEN];
  625. #endif
  626.  
  627. /* An input line is one of these three types. */
  628. static enum { BLANK_LINE, COMMENT_LINE, CODE_LINE } line_type = BLANK_LINE;
  629.  
  630. /* Whether a tab or space character was found at the beginning of a line. */
  631. static BOOLEAN found_tab;
  632. static BOOLEAN found_space;
  633.  
  634. /*
  635.    Pointer to current keyword or identifier as passed to rules if such a token
  636.    is encountered.
  637. */
  638. static char *current_keyword;
  639. static char *current_identifier;
  640.  
  641. #line 79 "c:\mks/etc/yylex.c"
  642.  
  643.  
  644. #ifdef    YY_DEBUG
  645. #undef    YY_DEBUG
  646. #define    YY_DEBUG(fmt, a1, a2)    fprintf(stderr, fmt, a1, a2)
  647. #else
  648. #define    YY_DEBUG(fmt, a1, a2)
  649. #endif
  650.  
  651. /*
  652.  * The declaration for the lex scanner can be changed by
  653.  * redefining YYLEX or YYDECL. This must be done if you have
  654.  * more than one scanner in a program.
  655.  */
  656. #ifndef    YYLEX
  657. #define    YYLEX yylex            /* name of lex scanner */
  658. #endif
  659.  
  660. #ifndef YYDECL
  661. #define    YYDECL    int YYLEX YY_ARGS((void))    /* declaration for lex scanner */
  662. #endif
  663.  
  664. /* stdin and stdout may not neccessarily be constants */
  665. YY_DECL    FILE   *yyin = NULL;
  666. YY_DECL    FILE   *yyout = NULL;
  667. YY_DECL    int    yylineno = 1;        /* line number */
  668. YY_DECL    int    yyleng = 0;        /* yytext token length */
  669.  
  670. /*
  671.  * yy_tbuf is an alias for yytext.
  672.  * yy_sbuf[0:yyleng-1] contains the states corresponding to yy_tbuf.
  673.  * yy_tbuf[0:yyleng-1] contains the current token.
  674.  * yy_tbuf[yyleng:yy_end-1] contains pushed-back characters.
  675.  * When the user action routine is active,
  676.  * yy_save contains yy_tbuf[yyleng], which is set to '\0'.
  677.  * Things are different when YY_PRESERVE is defined. 
  678.  */
  679.  
  680. YY_DECL    unsigned char yy_tbuf [YYLMAX+1]; /* text buffer (really yytext) */
  681. static    yy_state_t yy_sbuf [YYLMAX+1];    /* state buffer */
  682.  
  683. static    int    yy_end = 0;        /* end of pushback */
  684. static    int    yy_start = 0;        /* start state */
  685. static    int    yy_lastc = YYNEWLINE;    /* previous char */
  686.  
  687. #ifndef YY_PRESERVE    /* the efficient default push-back scheme */
  688.  
  689. static    unsigned char yy_save;    /* saved yytext[yyleng] */
  690.  
  691. #define    YY_USER    { /* set up yytext for user */ \
  692.         yy_save = yytext[yyleng]; \
  693.         yytext[yyleng] = 0; \
  694.     }
  695. #define    YY_SCANNER { /* set up yytext for scanner */ \
  696.         yytext[yyleng] = yy_save; \
  697.     }
  698.  
  699. #else        /* not-so efficient push-back for yytext mungers */
  700.  
  701. static    unsigned char yy_save [YYLMAX];
  702. static    unsigned char *yy_push = yy_save+YYLMAX;
  703.  
  704. #define    YY_USER { \
  705.         size_t n = yy_end - yyleng; \
  706.         yy_push = yy_save+YYLMAX - n; \
  707.         if (n > 0) \
  708.             memmove(yy_push, yytext+yyleng, n); \
  709.         yytext[yyleng] = 0; \
  710.     }
  711. #define    YY_SCANNER { \
  712.         size_t n = yy_save+YYLMAX - yy_push; \
  713.         if (n > 0) \
  714.             memmove(yytext+yyleng, yy_push, n); \
  715.         yy_end = yyleng + n; \
  716.     }
  717.  
  718. #endif
  719.  
  720. /*
  721.  * The actual lex scanner (usually yylex(void)).
  722.  */
  723. YYDECL {
  724.  
  725. #line 161 "c:\mks/etc/yylex.c"
  726.  
  727.     register int c, i, yyst, yybase;
  728.     int yyfmin, yyfmax;        /* yy_la_act indices of final states */
  729.     int yyoldi, yyoleng;        /* base i, yyleng before look-ahead */
  730.  
  731.     if (yyin == NULL)        /* for silly compilers (yes, I know)*/
  732.         yyin = stdin;
  733.     if (yyout == NULL)
  734.         yyout = stdout;
  735.     i = yyleng;
  736.     YY_SCANNER;
  737.  
  738.   yy_again:
  739.     yyleng = i;
  740.     /* determine previous char. */
  741.     if (i > 0)
  742.         yy_lastc = yytext[i-1];
  743.     /* scan previously accepted token adjusting yylineno */
  744.     while (i > 0)
  745.         if (yytext[--i] == YYNEWLINE)
  746.             yylineno++;
  747.     /* adjust pushback */
  748.     yy_end -= yyleng;
  749.     memmove(yytext, yytext+yyleng, (size_t) yy_end);
  750.     i = 0;
  751.  
  752.   yy_contin:
  753.     yyoldi = i;
  754.  
  755.     /* run the state machine until it jams */
  756.     for (yy_sbuf[i] = yyst = yy_begin[yy_start + (yy_lastc == YYNEWLINE)];
  757.          !(yyst == yy_endst || YY_INTERACTIVE && yy_base[yyst] > yy_nxtmax && yy_default[yyst] == yy_endst);
  758.          yy_sbuf[++i] = yyst) {
  759.         YY_DEBUG(gettext("<state %d, i = %d>\n"), yyst, i);
  760.         if (i >= YYLMAX)
  761.             YY_FATAL(gettext("Token buffer overflow"));
  762.  
  763.         /* get input char */
  764.         if (i < yy_end)
  765.             c = yy_tbuf[i];        /* get pushback char */
  766.         else if ((c = yygetc()) != EOF) {
  767.             yy_end = i+1;
  768.             yy_tbuf[i] = c = (unsigned char) c;
  769.         } else /* c == EOF */ {
  770.             if (i == yyoldi)    /* no token */
  771.                 if (yywrap())
  772.                     return 0;
  773.                 else
  774.                     goto yy_again;
  775.             else
  776.                 break;
  777.         }
  778.         YY_DEBUG(gettext("<input %d = 0x%02x>\n"), c, c);
  779.  
  780.         /* look up next state */
  781.         while ((yybase = yy_base[yyst]+c) > yy_nxtmax || yy_check[yybase] != yyst) {
  782.             if (yyst == yy_endst)
  783.                 goto yy_jammed;
  784.             yyst = yy_default[yyst];
  785.         }
  786.         yyst = yy_next[yybase];
  787.       yy_jammed: ;
  788.     }
  789.     YY_DEBUG(gettext("<stopped %d, i = %d>\n"), yyst, i);
  790.     if (yyst != yy_endst)
  791.         ++i;
  792.  
  793.   yy_search:
  794.     /* search backward for a final state */
  795.     while (--i > yyoldi) {
  796.         yyst = yy_sbuf[i];
  797.         if ((yyfmin = yy_final[yyst]) < (yyfmax = yy_final[yyst+1]))
  798.             goto yy_found;    /* found final state(s) */
  799.     }
  800.     /* no match, default action */
  801.     i = yyoldi + 1;
  802.     output(yy_tbuf[yyoldi]);
  803.     goto yy_again;
  804.  
  805.   yy_found:
  806.     YY_DEBUG(gettext("<final state %d, i = %d>\n"), yyst, i);
  807.     yyoleng = i;        /* save length for REJECT */
  808.     
  809.     /* pushback look-ahead RHS */
  810.     if ((c = (int)(yy_la_act[yyfmin]>>9) - 1) >= 0) { /* trailing context? */
  811.         unsigned char *bv = yy_look + c*YY_LA_SIZE;
  812.         static unsigned char bits [8] = {
  813.             1<<0, 1<<1, 1<<2, 1<<3, 1<<4, 1<<5, 1<<6, 1<<7
  814.         };
  815.         while (1) {
  816.             if (--i < yyoldi) {    /* no / */
  817.                 i = yyoleng;
  818.                 break;
  819.             }
  820.             yyst = yy_sbuf[i];
  821.             if (bv[(unsigned)yyst/8] & bits[(unsigned)yyst%8])
  822.                 break;
  823.         }
  824.     }
  825.  
  826.     /* perform action */
  827.     yyleng = i;
  828.     YY_USER;
  829.     switch (yy_la_act[yyfmin] & 0777) {
  830.     case 0:
  831. #line 222 "scan.l"
  832.     { comment();   /* Read in rest of comment. */ }
  833.     break;
  834.     case 1:
  835. #line 223 "scan.l"
  836.     {
  837.                            char *temp_file_name;
  838.  
  839.                            count();
  840.  
  841.                            /* Don't know why had to subtract 1. Oh well. */
  842.                            yylineno = extract_line_number(yytext) - 1;
  843.  
  844.                            /* Use new file name if present. */
  845.                            temp_file_name = extract_file_name(yytext);
  846.                            if (temp_file_name != NULL)
  847.                               input_file_orig_name = temp_file_name;
  848.                         }
  849.     break;
  850.     case 2:
  851. #line 237 "scan.l"
  852.     {  /*
  853.                               For this and the following keywords, do
  854.                               some lexical accounting, fire the keyword
  855.                               trigger in case a rule uses a keyword as a
  856.                               trigger, then return token to parser.
  857.                            */
  858.                            count(); fire_keyword(); return(TK_AUTO); }
  859.     break;
  860.     case 3:
  861. #line 244 "scan.l"
  862.     { count(); fire_keyword(); return(TK_BREAK); }
  863.     break;
  864.     case 4:
  865. #line 245 "scan.l"
  866.     { count(); fire_keyword(); return(TK_CASE); }
  867.     break;
  868.     case 5:
  869. #line 246 "scan.l"
  870.     { count(); fire_keyword(); return(TK_CHAR); }
  871.     break;
  872.     case 6:
  873. #line 247 "scan.l"
  874.     { count(); fire_keyword(); return(TK_CONST); }
  875.     break;
  876.     case 7:
  877. #line 248 "scan.l"
  878.     { count(); fire_keyword(); return(TK_CONTINUE); }
  879.     break;
  880.     case 8:
  881. #line 249 "scan.l"
  882.     { count(); fire_keyword(); return(TK_DEFAULT); }
  883.     break;
  884.     case 9:
  885. #line 250 "scan.l"
  886.     { count(); fire_keyword(); return(TK_DO); }
  887.     break;
  888.     case 10:
  889. #line 251 "scan.l"
  890.     { count(); fire_keyword(); return(TK_DOUBLE); }
  891.     break;
  892.     case 11:
  893. #line 252 "scan.l"
  894.     { count(); fire_keyword(); return(TK_ELSE); }
  895.     break;
  896.     case 12:
  897. #line 253 "scan.l"
  898.     { count(); fire_keyword(); return(TK_ENUM); }
  899.     break;
  900.     case 13:
  901. #line 254 "scan.l"
  902.     { count(); fire_keyword(); return(TK_EXTERN); }
  903.     break;
  904.     case 14:
  905. #line 255 "scan.l"
  906.     { count(); fire_keyword(); return(TK_FLOAT); }
  907.     break;
  908.     case 15:
  909. #line 256 "scan.l"
  910.     { count(); fire_keyword(); return(TK_FOR); }
  911.     break;
  912.     case 16:
  913. #line 257 "scan.l"
  914.     { count(); fire_keyword(); return(TK_GOTO); }
  915.     break;
  916.     case 17:
  917. #line 258 "scan.l"
  918.     { count(); fire_keyword(); return(TK_IF); }
  919.     break;
  920.     case 18:
  921. #line 259 "scan.l"
  922.     { count(); fire_keyword(); return(TK_INT); }
  923.     break;
  924.     case 19:
  925. #line 260 "scan.l"
  926.     { count(); fire_keyword(); return(TK_LONG); }
  927.     break;
  928.     case 20:
  929. #line 261 "scan.l"
  930.     { count(); fire_keyword(); return(TK_REGISTER); }
  931.     break;
  932.     case 21:
  933. #line 262 "scan.l"
  934.     { count(); fire_keyword(); return(TK_RETURN); }
  935.     break;
  936.     case 22:
  937. #line 263 "scan.l"
  938.     { count(); fire_keyword(); return(TK_SHORT); }
  939.     break;
  940.     case 23:
  941. #line 264 "scan.l"
  942.     { count(); fire_keyword(); return(TK_SIGNED); }
  943.     break;
  944.     case 24:
  945. #line 265 "scan.l"
  946.     { count(); fire_keyword(); return(TK_SIZEOF); }
  947.     break;
  948.     case 25:
  949. #line 266 "scan.l"
  950.     { count(); fire_keyword(); return(TK_STATIC); }
  951.     break;
  952.     case 26:
  953. #line 267 "scan.l"
  954.     { count(); fire_keyword(); return(TK_STRUCT); }
  955.     break;
  956.     case 27:
  957. #line 268 "scan.l"
  958.     { count(); fire_keyword(); return(TK_SWITCH); }
  959.     break;
  960.     case 28:
  961. #line 269 "scan.l"
  962.     { count(); fire_keyword(); return(TK_TYPEDEF); }
  963.     break;
  964.     case 29:
  965. #line 270 "scan.l"
  966.     { count(); fire_keyword(); return(TK_UNION); }
  967.     break;
  968.     case 30:
  969. #line 271 "scan.l"
  970.     { count(); fire_keyword(); return(TK_UNSIGNED); }
  971.     break;
  972.     case 31:
  973. #line 272 "scan.l"
  974.     { count(); fire_keyword(); return(TK_VOID); }
  975.     break;
  976.     case 32:
  977. #line 273 "scan.l"
  978.     { count(); fire_keyword(); return(TK_VOLATILE); }
  979.     break;
  980.     case 33:
  981. #line 274 "scan.l"
  982.     { count(); fire_keyword(); return(TK_WHILE); }
  983.     break;
  984.     case 34:
  985. #line 276 "scan.l"
  986.     {
  987.                            /*
  988.                               If a replacement was provided on the
  989.                               command line for this identifier, rescan
  990.                               input which will now have the replacement
  991.                               characters.  Otherwise, do some lexical
  992.                               accounting, fire the identifier trigger in
  993.                               case a rule uses an identifier in a
  994.                               trigger, then return token to parser (this
  995.                               is either an identifier or a typedef type
  996.                               name).
  997.                            */
  998.                            if (!identifier_defined(yytext))
  999.                            {
  1000.                               count();
  1001.                               fire_identifier();
  1002.                               return(check_type());
  1003.                            }
  1004.                         }
  1005.     break;
  1006.     case 35:
  1007. #line 296 "scan.l"
  1008.     {  /*
  1009.                               For this and the following constants and
  1010.                               string literals, do some lexical
  1011.                               accounting and return token to parser.
  1012.                            */
  1013.                            count(); return(TK_CONSTANT); }
  1014.     break;
  1015.     case 36:
  1016. #line 302 "scan.l"
  1017.     { count(); return(TK_CONSTANT); }
  1018.     break;
  1019.     case 37:
  1020. #line 303 "scan.l"
  1021.     { count(); return(TK_CONSTANT); }
  1022.     break;
  1023.     case 38:
  1024. #line 304 "scan.l"
  1025.     { count(); return(TK_CONSTANT); }
  1026.     break;
  1027.     case 39:
  1028. #line 305 "scan.l"
  1029.     { count(); return(TK_CONSTANT); }
  1030.     break;
  1031.     case 40:
  1032. #line 306 "scan.l"
  1033.     { count(); return(TK_CONSTANT); }
  1034.     break;
  1035.     case 41:
  1036. #line 307 "scan.l"
  1037.     { count(); return(TK_CONSTANT); }
  1038.     break;
  1039.     case 42:
  1040. #line 308 "scan.l"
  1041.     { count(); return(TK_CONSTANT); }
  1042.     break;
  1043.     case 43:
  1044. #line 309 "scan.l"
  1045.     { count(); return(TK_CONSTANT); }
  1046.     break;
  1047.     case 44:
  1048. #line 310 "scan.l"
  1049.     { count(); return(TK_CONSTANT); }
  1050.     break;
  1051.     case 45:
  1052. #line 311 "scan.l"
  1053.     { count(); return(TK_STRING_LITERAL); }
  1054.     break;
  1055.     case 46:
  1056. #line 313 "scan.l"
  1057.     {  /*
  1058.                               For this and the following operators, do
  1059.                               some lexical accounting and return token
  1060.                               to parser.
  1061.                            */
  1062.                            count(); return(TK_ELIPSIS); }
  1063.     break;
  1064.     case 47:
  1065. #line 319 "scan.l"
  1066.     { count(); return(TK_RIGHT_ASSIGN); }
  1067.     break;
  1068.     case 48:
  1069. #line 320 "scan.l"
  1070.     { count(); return(TK_LEFT_ASSIGN); }
  1071.     break;
  1072.     case 49:
  1073. #line 321 "scan.l"
  1074.     { count(); return(TK_ADD_ASSIGN); }
  1075.     break;
  1076.     case 50:
  1077. #line 322 "scan.l"
  1078.     { count(); return(TK_SUB_ASSIGN); }
  1079.     break;
  1080.     case 51:
  1081. #line 323 "scan.l"
  1082.     { count(); return(TK_MUL_ASSIGN); }
  1083.     break;
  1084.     case 52:
  1085. #line 324 "scan.l"
  1086.     { count(); return(TK_DIV_ASSIGN); }
  1087.     break;
  1088.     case 53:
  1089. #line 325 "scan.l"
  1090.     { count(); return(TK_MOD_ASSIGN); }
  1091.     break;
  1092.     case 54:
  1093. #line 326 "scan.l"
  1094.     { count(); return(TK_AND_ASSIGN); }
  1095.     break;
  1096.     case 55:
  1097. #line 327 "scan.l"
  1098.     { count(); return(TK_XOR_ASSIGN); }
  1099.     break;
  1100.     case 56:
  1101. #line 328 "scan.l"
  1102.     { count(); return(TK_OR_ASSIGN); }
  1103.     break;
  1104.     case 57:
  1105. #line 329 "scan.l"
  1106.     { count(); return(TK_RIGHT_OP); }
  1107.     break;
  1108.     case 58:
  1109. #line 330 "scan.l"
  1110.     { count(); return(TK_LEFT_OP); }
  1111.     break;
  1112.     case 59:
  1113. #line 331 "scan.l"
  1114.     { count(); return(TK_INC_OP); }
  1115.     break;
  1116.     case 60:
  1117. #line 332 "scan.l"
  1118.     { count(); return(TK_DEC_OP); }
  1119.     break;
  1120.     case 61:
  1121. #line 333 "scan.l"
  1122.     { count(); return(TK_PTR_OP); }
  1123.     break;
  1124.     case 62:
  1125. #line 334 "scan.l"
  1126.     { count(); return(TK_AND_OP); }
  1127.     break;
  1128.     case 63:
  1129. #line 335 "scan.l"
  1130.     { count(); return(TK_OR_OP); }
  1131.     break;
  1132.     case 64:
  1133. #line 336 "scan.l"
  1134.     { count(); return(TK_LE_OP); }
  1135.     break;
  1136.     case 65:
  1137. #line 337 "scan.l"
  1138.     { count(); return(TK_GE_OP); }
  1139.     break;
  1140.     case 66:
  1141. #line 338 "scan.l"
  1142.     { count(); return(TK_EQ_OP); }
  1143.     break;
  1144.     case 67:
  1145. #line 339 "scan.l"
  1146.     { count(); return(TK_NE_OP); }
  1147.     break;
  1148.     case 68:
  1149. #line 340 "scan.l"
  1150.     { count(); return(';'); }
  1151.     break;
  1152.     case 69:
  1153. #line 341 "scan.l"
  1154.     { count(); return('{'); }
  1155.     break;
  1156.     case 70:
  1157. #line 342 "scan.l"
  1158.     { count(); return('}'); }
  1159.     break;
  1160.     case 71:
  1161. #line 343 "scan.l"
  1162.     { count(); return(','); }
  1163.     break;
  1164.     case 72:
  1165. #line 344 "scan.l"
  1166.     { count(); return(':'); }
  1167.     break;
  1168.     case 73:
  1169. #line 345 "scan.l"
  1170.     { count(); return('='); }
  1171.     break;
  1172.     case 74:
  1173. #line 346 "scan.l"
  1174.     { count(); return('('); }
  1175.     break;
  1176.     case 75:
  1177. #line 347 "scan.l"
  1178.     { count(); return(')'); }
  1179.     break;
  1180.     case 76:
  1181. #line 348 "scan.l"
  1182.     { count(); return('['); }
  1183.     break;
  1184.     case 77:
  1185. #line 349 "scan.l"
  1186.     { count(); return(']'); }
  1187.     break;
  1188.     case 78:
  1189. #line 350 "scan.l"
  1190.     { count(); return('.'); }
  1191.     break;
  1192.     case 79:
  1193. #line 351 "scan.l"
  1194.     { count(); return('&'); }
  1195.     break;
  1196.     case 80:
  1197. #line 352 "scan.l"
  1198.     { count(); return('!'); }
  1199.     break;
  1200.     case 81:
  1201. #line 353 "scan.l"
  1202.     { count(); return('~'); }
  1203.     break;
  1204.     case 82:
  1205. #line 354 "scan.l"
  1206.     { count(); return('-'); }
  1207.     break;
  1208.     case 83:
  1209. #line 355 "scan.l"
  1210.     { count(); return('+'); }
  1211.     break;
  1212.     case 84:
  1213. #line 356 "scan.l"
  1214.     { count(); return('*'); }
  1215.     break;
  1216.     case 85:
  1217. #line 357 "scan.l"
  1218.     { count(); return('/'); }
  1219.     break;
  1220.     case 86:
  1221. #line 358 "scan.l"
  1222.     { count(); return('%'); }
  1223.     break;
  1224.     case 87:
  1225. #line 359 "scan.l"
  1226.     { count(); return('<'); }
  1227.     break;
  1228.     case 88:
  1229. #line 360 "scan.l"
  1230.     { count(); return('>'); }
  1231.     break;
  1232.     case 89:
  1233. #line 361 "scan.l"
  1234.     { count(); return('^'); }
  1235.     break;
  1236.     case 90:
  1237. #line 362 "scan.l"
  1238.     { count(); return('|'); }
  1239.     break;
  1240.     case 91:
  1241. #line 363 "scan.l"
  1242.     { count(); return('?'); }
  1243.     break;
  1244.     case 92:
  1245. #line 365 "scan.l"
  1246.     {  /* Absorb whitespace character. */
  1247.                            count(); }
  1248.     break;
  1249.     case 93:
  1250. #line 367 "scan.l"
  1251.     { INCR_YYLINENO; count(); }
  1252.     break;
  1253.     case 94:
  1254. #line 369 "scan.l"
  1255.     {  /* Ignore preprocessor directives. */
  1256.                            count(); }
  1257.     break;
  1258.     case 95:
  1259. #line 372 "scan.l"
  1260.     {  /* Trap any non-standard characters. */
  1261.                            count(); found_nonstandard(); }
  1262.     break;
  1263.  
  1264. #line 265 "c:\mks/etc/yylex.c"
  1265.  
  1266.     }
  1267.     YY_SCANNER;
  1268.     i = yyleng;
  1269.     goto yy_again;            /* action fell though */
  1270.  
  1271.   yy_reject:
  1272.     YY_SCANNER;
  1273.     i = yyoleng;            /* restore original yytext */
  1274.     if (++yyfmin < yyfmax)
  1275.         goto yy_found;        /* another final state, same length */
  1276.     else
  1277.         goto yy_search;        /* try shorter yytext */
  1278.  
  1279.   yy_more:
  1280.     YY_SCANNER;
  1281.     i = yyleng;
  1282.     if (i > 0)
  1283.         yy_lastc = yytext[i-1];
  1284.     goto yy_contin;
  1285. }
  1286.  
  1287. /*
  1288.  * user callable input/unput functions.
  1289.  */
  1290.  
  1291. /* get input char with pushback */
  1292. YY_DECL int
  1293. input()
  1294. {
  1295.     int c;
  1296. #ifndef YY_PRESERVE
  1297.     if (yy_end > yyleng) {
  1298.         yy_end--;
  1299.         memmove(yytext+yyleng, yytext+yyleng+1,
  1300.             (size_t) (yy_end-yyleng));
  1301.         c = yy_save;
  1302.         YY_USER;
  1303. #else
  1304.     if (yy_push < yy_save+YYLMAX) {
  1305.         c = *yy_push++;
  1306. #endif
  1307.     } else
  1308.         c = yygetc();
  1309.     yy_lastc = c;
  1310.     if (c == YYNEWLINE)
  1311.         yylineno++;
  1312.     return c;
  1313. }
  1314.  
  1315. /* pushback char */
  1316. YY_DECL int
  1317. unput(c)
  1318.     int c;
  1319. {
  1320. #ifndef YY_PRESERVE
  1321.     if (yy_end >= YYLMAX)
  1322.         YY_FATAL(gettext("Push-back buffer overflow"));
  1323.     if (yy_end > yyleng) {
  1324.         yytext[yyleng] = yy_save;
  1325.         memmove(yytext+yyleng+1, yytext+yyleng,
  1326.             (size_t) (yy_end-yyleng));
  1327.         yytext[yyleng] = 0;
  1328.     }
  1329.     yy_end++;
  1330.     yy_save = c;
  1331. #else
  1332.     if (yy_push <= yy_save)
  1333.         YY_FATAL(gettext("Push-back buffer overflow"));
  1334.     *--yy_push = c;
  1335. #endif
  1336.     if (c == YYNEWLINE)
  1337.         yylineno--;
  1338.     return c;
  1339. }
  1340.  
  1341. #line 376 "scan.l"
  1342.  
  1343. /*
  1344.    If a replacement string was specified on command line, substitute for
  1345.    this lexeme.  Return whether this identifier had a replacement string.
  1346. */
  1347. static BOOLEAN identifier_defined(char *id)
  1348. {
  1349.    unsigned i;
  1350.  
  1351.    /* Look through command-line arguments for the define option character. */
  1352.    for (i = 1; i < cmd_line_argc; ++i)
  1353.       if (strchr(OPT_INTRO_CHARS, cmd_line_argv[i][0]) != NULL &&
  1354.             toupper(cmd_line_argv[i][1]) == DEFINE_OPT_CHAR)
  1355.       {
  1356.          char *repl_str;
  1357.  
  1358.          /* Look for equal sign after identifier. */
  1359.          repl_str = (char *)strchr(&cmd_line_argv[i][2], '=');
  1360.  
  1361.          /*
  1362.             If equal sign found and this is a define for this
  1363.             identifier, substitute replacement string for this lexeme.
  1364.          */
  1365.          if (repl_str != NULL && strncmp(&cmd_line_argv[i][2], id,
  1366.                                        repl_str - &cmd_line_argv[i][2]) == 0)
  1367.          {
  1368.             unsigned len;
  1369.             char *p;
  1370.  
  1371.             /*
  1372.                unput replacement string so that lex will scan it in as
  1373.                if it occurred in the input stream instead of the
  1374.                original identifier.  NOTE: If empty replacement string,
  1375.                the affect is that the identifier is ignored.
  1376.             */
  1377.             for (len = strlen(&repl_str[1]), p = &repl_str[len]; len > 0;
  1378.                                                                      --len, --p)
  1379.                unput(*p);
  1380.  
  1381.             /*
  1382.                Leave outer loop because define option character found
  1383.                and processed.
  1384.             */
  1385.             break;
  1386.          }
  1387.       }
  1388.  
  1389.    return i < cmd_line_argc;
  1390. }
  1391.  
  1392. /* Initialize lexer. */
  1393. void init_lex(void)
  1394. {
  1395.    /*
  1396.       Restart lex itself.  Note: I don't believe that this is absolutely
  1397.       necessary for this lexer.  The lexer is not left in an unusual state
  1398.       after each file, e.g., characters left in the push-back buffer or the
  1399.       lexer being in a state other than INITIAL.  It is explicitly restarted
  1400.       here just because "it's the right thing to do."  If this macro reference
  1401.       expands to something that is not compatible with your lexer, although I
  1402.       tried to make it portable, just remove it.
  1403.    */
  1404.    MTR_YY_INIT;
  1405.  
  1406.    /* Reset line_type for first line.  Start off assuming blank line. */
  1407.    line_type = BLANK_LINE;
  1408.  
  1409.    yylineno = 1;
  1410.    found_tab = FALSE;
  1411.    found_space = FALSE;
  1412.    current_keyword = "";
  1413.    current_identifier = "";
  1414. }
  1415.  
  1416. #ifdef MTR_ATTLEX
  1417. /* Function that restarts AT&T lexers. */
  1418. static void yy_init(void)
  1419. {
  1420.    extern int yyprevious;
  1421.  
  1422.    NLSTATE;
  1423.    yysptr = yysbuf;
  1424.    BEGIN INITIAL;
  1425.  
  1426. /* I don't think these absolutely need to be reset. */
  1427. #if 0
  1428.    extern int *yyfnd;
  1429.    yyleng = 0;
  1430.    yytchar = 0;
  1431.    yymorfg = 0;
  1432.    yyestate = 0;
  1433.    yyfnd = 0;
  1434. #endif
  1435. }
  1436. #endif
  1437.  
  1438. /* Fire the keyword trigger. */
  1439. static void fire_keyword(void)
  1440. {
  1441.    current_keyword = yytext;
  1442.    rules();
  1443.    current_keyword = "";
  1444. }
  1445.  
  1446. /* Fire the identifier trigger. */
  1447. static void fire_identifier(void)
  1448. {
  1449.    current_identifier = yytext;
  1450.    rules();
  1451.    current_identifier = "";
  1452. }
  1453.  
  1454.  
  1455. #if READ_LINE
  1456.  
  1457. /* Pointer to next character in input_line[]. */
  1458. static char *next_char_p;
  1459.  
  1460. /*
  1461.    Replacement for the out-of-the-box yygetc().  This function provides
  1462.    access to the entire input line, even the characters that have not
  1463.    yet been scanned in.
  1464. */
  1465. static int yygetc(void)
  1466. {
  1467.    static char last_char = EOF;   /* Force subsequent getting of first line.*/
  1468.    char next_char;
  1469.    int characters_read;
  1470.  
  1471.    switch (last_char)
  1472.    {
  1473.    case '\n':        /* Time to get another line of input? */
  1474.    case EOF:
  1475.       YY_INPUT(input_line, characters_read, INPUT_LINE_MAX_LEN);
  1476.       if (characters_read == 0)
  1477.       {
  1478.          next_char = EOF;           /* Indicate that couldn't get another line*/
  1479.          next_char_p = input_line;  /* Set to something. */
  1480.       }
  1481.       else
  1482.       {
  1483.          next_char_p = input_line;
  1484.          next_char = *next_char_p++;   /* Get first character from input line. */
  1485.       }
  1486.       break;
  1487.  
  1488.    default:                         /* Get next character from input line. */
  1489.       next_char = *next_char_p++;
  1490.    }
  1491.  
  1492.    last_char = next_char;
  1493.  
  1494.    return next_char;
  1495. }
  1496.  
  1497. /* Read next line from input file, returning number of characters read. */
  1498. static int my_yyinput(char *buf, int max_size)
  1499. {
  1500.    int characters_read;
  1501.  
  1502.    if (fgets(buf, max_size, yyin) == NULL)
  1503.       buf[0] = '\0';
  1504.    else
  1505.       /* This is where the input line is printed if display_print is TRUE. */
  1506.       if (display_input)
  1507.          fputs(buf, out_fp);
  1508.  
  1509.    return strlen(buf);
  1510. }
  1511.  
  1512. #endif      /* #if READ_LINE */
  1513.  
  1514. /*
  1515.    Called by yacc at the end of a source file.  If there are more files to
  1516.    process, open them and continue, else stop.
  1517. */
  1518. yywrap()
  1519. {
  1520.    int ret_val;
  1521.  
  1522.    /* Provide module information then fire the end-of-module trigger. */
  1523.    int_mod.decisions = mod_decisions;
  1524.    int_mod.functions = mod_functions;
  1525.    int_mod.lines.total = yylineno - 1;
  1526.    int_mod.end = TRUE;
  1527.    fire_mod();
  1528.    int_mod.end = FALSE;
  1529.    ZERO(int_mod);
  1530.  
  1531.    /* See whether there is another input file to process. */
  1532.    if (next_cmd_line_file < cmd_line_argc &&
  1533.          (input_file = get_next_input_file(&next_cmd_line_file)) != NULL)
  1534.       if (freopen(input_file, "r", yyin) != NULL)
  1535.       {
  1536.          /* Reinitialize yacc and lex. */
  1537.          init_yacc();
  1538.          init_lex();
  1539.  
  1540.          /*
  1541.             See whether to use the original file name as provided on the
  1542.             command line rather than the file name that was provided.  This
  1543.             is in case the output of the preprocessor is the input file and
  1544.             there are no line directives, but we'd like to use the name of
  1545.             the input to the preprocessor.
  1546.          */
  1547.          input_file_orig_name =
  1548.                get_next_input_file_orig_name(&next_cmd_line_file_orig_n);
  1549.          if (input_file_orig_name == NULL)
  1550.             input_file_orig_name = input_file;
  1551.  
  1552.          /* Fire the beginning-of-module trigger. */
  1553.          ZERO(int_mod);
  1554.          int_mod.begin = TRUE;
  1555.          fire_mod();
  1556.          int_mod.begin = FALSE;
  1557.  
  1558.          /* Tell yacc to continue. */
  1559.          ret_val = 0;
  1560.       }
  1561.       else
  1562.       {
  1563.          warn(W_CANNOT_OPEN_FILE, input_file);
  1564.  
  1565.          /* Fire the end-of-project trigger. */
  1566.          int_prj.end = TRUE;
  1567.          fire_prj();
  1568.          int_prj.end = FALSE;
  1569.          ZERO(int_prj);
  1570.  
  1571.          /* Tell yacc to stop. */
  1572.          ret_val = 1;
  1573.       }
  1574.    else
  1575.    {
  1576.       /* Fire the end-of-project trigger. */
  1577.       int_prj.end = TRUE;
  1578.       fire_prj();
  1579.       int_prj.end = FALSE;
  1580.       ZERO(int_prj);
  1581.  
  1582. #ifdef DEBUG_TYPEDEF
  1583.       /* Used for debugging typedef processing. */
  1584.       typedef_symbol_table_dump();
  1585. #endif
  1586.  
  1587.       /* Tell yacc to stop. */
  1588.       ret_val = 1;
  1589.    }
  1590.  
  1591.    return ret_val;
  1592. }
  1593.  
  1594. /*
  1595.    The beginning of a comment has been detected.  Handle until the entire
  1596.    comment has been consumed, then give control back over to lex.
  1597. */
  1598. static void comment(void)
  1599. {
  1600.    char c;
  1601.  
  1602.    /* If this was just a blank line, it now becomes a comment line. */
  1603.    if (line_type == BLANK_LINE)
  1604.       line_type = COMMENT_LINE;
  1605.  
  1606.    /* Loop until input exhausted or end-of-comment reached. */
  1607.    for ( ; (c = input()) != '\0'; )
  1608.       if (c == '*')                    /* Could be end-of-comment. */
  1609.       {
  1610.          char c1;
  1611.  
  1612.          if ((c1 = input()) == '/')
  1613.             break;                     /* Is end-of-comment. */
  1614.          else
  1615.             unput(c1);                 /* False alarm.  Not end-of-comment. */
  1616.       }
  1617.       else if (c == '\n')
  1618.       {
  1619.          INCR_YYLINENO;
  1620.  
  1621.          /* Provide line information then fire the end-of-line trigger. */
  1622.          int_lin.number = yylineno;
  1623.          int_lin.is_comment = TRUE;
  1624.          int_lin.end = TRUE;
  1625.          fire_lin();
  1626.          ZERO(int_lin);
  1627.  
  1628.          /* Reset these BOOLEANs for the next line. */
  1629.          found_tab = FALSE;
  1630.          found_space = FALSE;
  1631.  
  1632.          /* Increment the number-of-comment-lines counter. */
  1633.          ++int_mod.lines.com;
  1634.       }
  1635. }
  1636.  
  1637. /*
  1638.    Count various things associated with input tokens.  All input, except
  1639.    for comments and preprocessor lines pass through here.
  1640. */
  1641. static void count(void)
  1642. {
  1643.    int i;
  1644.  
  1645.    for (i = 0; yytext[i] != '\0'; i++)
  1646.       switch (yytext[i])
  1647.       {
  1648.       case '\n':
  1649.          /* Provide line information then fire the end-of-line trigger. */
  1650.          switch (line_type)
  1651.          {
  1652.          case BLANK_LINE:
  1653.             int_lin.is_white = TRUE;
  1654.             ++int_mod.lines.white;
  1655.             break;
  1656.  
  1657.          case COMMENT_LINE:
  1658.             int_lin.is_comment = TRUE;
  1659.             ++int_mod.lines.com;
  1660.             break;
  1661.  
  1662.          case CODE_LINE:
  1663.             int_lin.is_exec = TRUE;
  1664.             ++int_mod.lines.exec;
  1665.             break;
  1666.  
  1667.          default:
  1668.             fatal(E_LINE_TYPE);
  1669.          }
  1670.          /* Reset line_type for next line.  Start off assuming blank line. */
  1671.          line_type = BLANK_LINE;
  1672.  
  1673.          int_lin.number = yylineno;
  1674.          int_lin.end = TRUE;
  1675.          fire_lin();
  1676.          ZERO(int_lin);
  1677.  
  1678.          /* Reset these BOOLEANs for the next line. */
  1679.          found_tab = FALSE;
  1680.          found_space = FALSE;
  1681.          break;
  1682.  
  1683.       /*
  1684.          The next two cases are trying to figure out whether spaces and tabs
  1685.          are both being used for indention on the same line--a little pet peeve
  1686.          of mine.
  1687.       */
  1688.       case '\t':
  1689.          if (line_type == BLANK_LINE && found_space)
  1690.             int_lin.is_mixed_indent = TRUE;
  1691.          found_tab = TRUE;
  1692.          break;
  1693.  
  1694.       case ' ':
  1695.          if (line_type == BLANK_LINE && found_tab)
  1696.             int_lin.is_mixed_indent = TRUE;
  1697.          found_space = TRUE;
  1698.          break;
  1699.  
  1700.       default:
  1701.          /*
  1702.             If not one of the above, special characters, there must be code on
  1703.             this line.
  1704.          */
  1705.          if (isgraph(yytext[i]))
  1706.             line_type = CODE_LINE;
  1707.       }
  1708. }
  1709.  
  1710. /*
  1711.    Return whether the token in yytext[] is just an identifier or is a
  1712.    previously typedef'd name.
  1713. */
  1714. static int check_type(void)
  1715. {
  1716.    int type;
  1717.  
  1718.    /*
  1719.       looking_for_tag is set to TRUE only when the parser is looking for a
  1720.       struct, union, or enum tag.  Since tags are in a separate name space,
  1721.       the current lexeme can never be a typedef type name and are therefore
  1722.       always an identifier.
  1723.    */
  1724.    if (looking_for_tag)
  1725.       type = TK_IDENTIFIER;
  1726.    else
  1727.       /*
  1728.          If lexeme was previously defined as a typedef type name, return
  1729.          token for type name, else return token for identifier.  Note that
  1730.          the parser puts identifiers in the typedef symbol table, not the
  1731.          lexer.
  1732.       */
  1733.       type = typedef_symbol_table_find(yytext) ? TK_TYPE_NAME : TK_IDENTIFIER;
  1734.  
  1735.    return type;
  1736. }
  1737.  
  1738. /* Return whether the specified keyword is the current keyword. */
  1739. BOOLEAN keyword(char *name)
  1740. {
  1741.    return strcmp(current_keyword, name) == 0;
  1742. }
  1743.  
  1744. /* Return whether the specified identifier is the current identifier. */
  1745. BOOLEAN identifier(char *name)
  1746. {
  1747.    return strcmp(current_identifier, name) == 0;
  1748. }
  1749.  
  1750. /* Return pointer to current input token (lexeme). */
  1751. char *token(void)
  1752. {
  1753.    return yytext;
  1754. }
  1755.  
  1756. /* Return pointer to input buffer which contains current line. */
  1757. char *line(void)
  1758. {
  1759. #if READ_LINE
  1760.    return input_line;
  1761. #else
  1762.    return "";
  1763. #endif
  1764. }
  1765.  
  1766. /*
  1767.    Return string with marker character indicating current position of parser.
  1768.    Note that this line always ends with a newline character.
  1769. */
  1770. char *marker(void)
  1771. {
  1772. #if READ_LINE
  1773.    static char marker_str[INPUT_LINE_MAX_LEN];
  1774.    char *dst_p, *src_p;
  1775.  
  1776.    /* Replace all graphic characters in input buffer with space character. */
  1777.    for (dst_p = marker_str, src_p = input_line;
  1778.          src_p < next_char_p && *src_p != '\0' &&
  1779.          /* Leave room for marker character, newline, and '\0'. */
  1780.          dst_p < marker_str + sizeof marker_str - 2;
  1781.          ++dst_p, ++src_p)
  1782.       *dst_p = isgraph(*src_p) ? ' ' : *src_p;
  1783.  
  1784.    if (dst_p == marker_str)
  1785.       strcpy(dst_p, "\n");       /* Nothing scanned in yet, so can't mark. */
  1786.    else
  1787.       strcpy(&dst_p[-1], "-\n"); /* Terminate line with marker character. */
  1788.  
  1789.    return marker_str;
  1790. #else
  1791.    return "";
  1792. #endif      /* #if READ_LINE */
  1793. }
  1794.  
  1795. /* Fire the lex trigger with nonstandard set to TRUE. */
  1796. static void found_nonstandard(void)
  1797. {
  1798.    int_lex.nonstandard = yytext[0];
  1799.    fire_lex();
  1800.    ZERO(int_lex);
  1801. }
  1802.  
  1803. /* Extract and return the line number out of the #line directive. */
  1804. static unsigned extract_line_number(char *string)
  1805. {
  1806.    return (unsigned)strtol(&string[strcspn(string, "0123456789")], NULL, 10);
  1807. }
  1808.  
  1809. /*
  1810.    Extract and return the file name out of the #line directive. If not present,
  1811.    return NULL.
  1812. */
  1813. static char *extract_file_name(char *string)
  1814. {
  1815.    char *start_of_file_name;
  1816.  
  1817.    /* File name is enclosed in quotes. Return NULL if no first quote. */
  1818.    start_of_file_name = strchr(string, '"');
  1819.    if (start_of_file_name != NULL)
  1820.    {
  1821.       char *end_of_file_name;
  1822.  
  1823.       ++start_of_file_name;      /* Skip past first quote. */
  1824.  
  1825.       /* If no trailing quote, return NULL. */
  1826.       end_of_file_name = strchr(start_of_file_name, '"');
  1827.       if (end_of_file_name == NULL)
  1828.          start_of_file_name = NULL;
  1829.       else
  1830.       {
  1831.          size_t file_name_length;
  1832.          static char return_buffer[MTR_YYTEXT_SIZE];
  1833.  
  1834.          file_name_length = end_of_file_name - start_of_file_name;
  1835.  
  1836.          /* Copy file name between quotes. */
  1837.          strncpy(return_buffer, start_of_file_name, file_name_length);
  1838.          return_buffer[file_name_length] = '\0';
  1839.  
  1840.          /* Buffer is static, so it's still viable after returning. */
  1841.          start_of_file_name = return_buffer;
  1842.       }
  1843.    }
  1844.  
  1845.    return start_of_file_name;
  1846. }
  1847.